<span class="<%= if @contract do %>contract-address<% end %>" data-address-hash="<%= @address %>">
  <%= if name = primary_name(@address) do %>
     <span data-toggle="tooltip" data-placement="top" title="<%= @address %>"><%= name %> (<%= short_hash(@address) %>...)</span>
  <% else %>
    <%= if assigns[:truncate] do %>
      <%= BlockScoutWeb.AddressView.trimmed_hash(@address.hash) %>
    <% else %>
      <span class="d-none d-md-none d-xl-inline"><%= @address %></span>
      <span class="d-md-inline-block d-xl-none"><%= BlockScoutWeb.AddressView.trimmed_hash(@address.hash) %></span>
    <% end %>
  <% end %>
</span>
